/**求1-10累加值
 * @author yuisama
 * @date 2022/03/21 17:38
 **/
import java.util.Scanner;
public class AddNumber {
    public static void main(String[] args) {
        System.out.println("请输入一个整数");
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        System.out.println(add(a));
    }
    public static int add(int  num){
        if(num==1){
            return num;
        }
        //此时只知道num的值
        return num+ add(num -1);
    }
}
